home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Atari Compendium
/
The Atari Compendium (Toad Computers) (1994).iso
/
files
/
umich
/
utils
/
undelete.arc
/
UNDELETE.DOC
next >
Wrap
Text File
|
1986-12-22
|
5KB
|
96 lines
U N D E L E T E User Notes
The ST directory structure
Skip this part if you like, but be advised that UNDELETE will not always be
able to recover your deleted file. This section will help you to understand
why.
In order to keep track of the files and folders on a disk, TOS records two sets
of data. The directory itself records the filename (or folder name), the time
and date of creation or modification, the file length, several special-purpose
flags (for example, 'read only'), and the location of the first 'cluster'
belonging to the file. On the ST a cluster is an adjacent pair of sectors, 1024
bytes.
A second set of data, the File Allocation Table or FAT, has an entry for each
cluster indicating if it is in use, and if so, where to find the next cluster
of this file, or whether this is the end-of-file cluster.
When TOS deletes a file, it does not erase the data in the file. Instead, it
indicates that the file has been erased by replacing the first character of the
file name with $E5 (i. e., decimal 229). It also modifies the File Allocation
Table to indicate that the clusters previously belonging to the file are now
available. It does this by writing a zero in the element corresponding to a
particular cluster.
When a new file is created, the first available directory entry is used; this
entry may have been previously used by a file that has been deleted, or it may
be an entry that has never been used since the disk was last formatted -- if
there are no '$E5' flags showing. Similarly, the newly created file (or, for
that matter, a file which is being rewritten, and now requires additional
clusters) uses the first available (empty -- showing '0') cluster, again
possibly re-using clusters belonging to, and still retaining data from, an
erased file.
Usually, if a single file has been erased, and no new file has been written
(including modified files), it is possible to reconstruct the directory and FAT
tables unamiguously. However, if several files have been deleted, proper
reconstruction may not be possible, since their clusters may be intermixed in
an unknown way. And if write activity has taken place on the disk since the
deletion, it is unlikely that the file can be recovered, since its directory
entry probably no longer exists.
How to use Undelete
Before going any further, I must repeat the warning that appears on the opening
screen of Undelete: ONLY USE UNDELETE ON A DUPLICATE OF YOUR DISK. If you use
the normal TOS function to copy the entire disk (not individual files), you
will have a copy of all of the necessary information for Undelete to work
without putting your original disk at risk.
Also, Undelete works only in medium resolution, and expects to find the subject
disk in Drive A:, so set up your ST accordingly.
Load UNDELETE.PRG, and place your (duplicate) disk in Drive A. After clicking
the OK box on the opening screen, select Undelete from the Function menu. A
first-level (root) directory will be displayed and will show:
1. Any deleted files which are still in the root directory, and
2. All folders in the root directory, deleted or otherwise (deleted folders
will show up with a '#' in the first character).
Selecting a deleted file or folder displays a dialog box requesting the initial
character (which has been replaced by the $E5 'delete flag'). After inserting
the initial character, selecting 'Recover' recovers the file or folder.
Selecting 'Cancel' will return you to the display of deleted files.
Selecting a non-deleted folder 'opens' the folder, showing all folders and all
deleted files at the next level within the folder. You may then continue as
with the root directory.
The 'close' box on the window will always back up the program by one stage. For
example, if a folder is open, the folder will be closed and the directory which
included the folder will be displayed. At the root directory, the close box
backs out of the undelete function so that no function is selected. Selecting
the close box again terminates the program.
Additional functions.
Since many of the same program procedures are required, a simple directory
function is a part of the program. It opens and closes folders in exactly the
same way as the undelete function.
A print function prints whatever directory is presently on the screen. This
works as a subfunction under both the directory function and the undelete
function.
A cancel function is also available; it immediately terminates the directory or
undelete function without terminating the program, and without having to back
out of several levels of subdirectories (folders) via the close box. The File
Allocation Table (FAT) is read only on initial selection of one of the
functions -- undelete or directory -- so a function should be canceled before
using it to operate on a new disk.